﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace AtletIS.Shared.Forms
{
    public partial class frmSplash : Form
    {
        private string nextForm;

        public frmSplash(string nextForm)
        {
            InitializeComponent();
            this.nextForm = nextForm;
        }

        private void frmSplash_Load(object sender, EventArgs e)
        {
            switch (nextForm)
            {
                case "frmMain":
                    lblTitle.Text = "AtletIS";
                    break;

                case "frmOnlineManager":
                    lblTitle.Text = "AtletIS :: Online Manager";
                    break;
                
                case "frmChipViewer":
                    lblTitle.Text = "AtletIS :: Chip Viewer";
                    break;

                case "frmTrack":
                    lblTitle.Text = "AtletIS :: Track";
                    break;

                case "frmSpeaker":
                    lblTitle.Text = "AtletIS :: Speaker";
                    break;

                case "frmSector":
                    lblTitle.Text = "AtletIS :: Sector";
                    break;

                case "frmWindSpeed":
                    lblTitle.Text = "AtletIS :: Wind Speed";
                    break;

                case "Press":
                    lblTitle.Text = "AtletIS :: Press";
                    break;

                case "frmBoardControl":
                    lblTitle.Text = "AtletIS :: Board Control";
                    break;

                case "frmSync":
                    lblTitle.Text = "AtletIS :: Sync";
                    break;
            }

            lblCopy.Text = "\u00A9 AtletIS " + DateTime.Now.Year.ToString();
        }

        private void tmrOff_Tick(object sender, EventArgs e)
        {
            tmrOff.Enabled = false;

            if (nextForm == "frmMain")
            {
                frmMain frm = new frmMain();
                frm.Show();
            }
            //else if (nextForm == "frmOnlineManager")
            //{
            //    frmOnlineManager frm = new frmOnlineManager();
            //    frm.Show();
            //}
            else if (nextForm == "Press")
            {
                frmWpf frm = new frmWpf("Press", null);
                frm.Show();
            }
            else if (nextForm == "frmBoardControl")
            {
                frmBoardControl frm = new frmBoardControl();
                frm.Show();
            }
            else if (nextForm == "frmSync")
            {
                frmSync frm = new frmSync();
                frm.Show();
            }
            else
            {
                frmDisciplineSelection frm = new frmDisciplineSelection(nextForm);
                frm.Show();
            }

            this.Dispose(false);
        }
    }
}
